package com.winding.plugin.swagger.enums;

/**
 * <p>TODO
 *
 * @author wind
 * @version 1.0
 * @since 2018/12/7
 */
public enum RequestMethod {
    /**
     * GET
     */
    GET,
    /**
     * HEAD
     */
    HEAD,
    /**
     * POST
     */
    POST,
    /**
     * PUT
     */
    PUT,
    /**
     * PATCH
     */
    PATCH,
    /**
     * DELETE
     */
    DELETE,
    /**
     * OPTIONS
     */
    OPTIONS,
    /**
     * TRACE
     */
    TRACE;

    private RequestMethod() {
    }

    public static RequestMethod get(String val) {
        for (RequestMethod requestMethod : RequestMethod.values()) {
            if (val.contains(requestMethod.name())) {
                return requestMethod;
            }
        }
        return null;
    }
}